1. Field of the Invention
The present invention relates to an improved data processing system and, in particular, to a method and apparatus for resource allocation within a runtime environment. Still more particularly, the present invention provides a method and apparatus for implementing the allocation of a specific resource using object-oriented late binding.
2. Description of Related Art
In many computer environments, it is desirable for a data processing system to handle many tasks concurrently. For example, a multi-threaded server can be used to simultaneously process transactions from multiple clients.
In many applications, a transaction needs to be assigned a unique identifier, such as for recording the transaction by management software or for use within the data processing of the transaction itself. In some cases, the unique identifiers must be assigned in strictly sequential order. When a particular transaction needs an identifier, the transaction is assigned the next identifier in the sequence of identifiers. If the transaction fails, then the assigned identifier must not be discarded and must be used for the next transaction without skipping any identifiers in the sequence. For example, an application might use pre-printed paper forms, such as tamper-proof tickets for a sporting event, on which the application outputs dynamically generated data. Each ticket must be printed in sequence, and the application would need to keep track of the number of tickets that have previously been printed. In general, unique identifiers can be classified as either global, in which case the identifiers must be unique across all possible clients, or local, in which case the identifiers must be unique for each categorization of clients. An example for using locally unique sequence of identifiers might include a situation in which each branch office of a company can have its own printer such that the identifiers need to be unique only for a given branch office.
As with most computational tasks, maintaining a sequence of unique identifiers should be accomplished not only accurately but also efficiently. A potential problem with sequencing unique identifiers involves the fact that once an identifier has been allocated, the next identifier in the sequence cannot be allocated until the preceding identifier has been successfully committed to the database. The strict sequencing process effectively limits the throughput on the server because of the potentially large synchronization delays.
Transaction processing on the server typically requires a number of pre-processing tasks before the transaction can be committed. The pre-processing tasks may include tasks such as validation, creation of new objects, and queries against the existing database. If a unique identifier is allocated too early, then all the other transactions are stymied until the blocking transaction has finished its tasks and commits to the database. Once the commit has occurred, then the next waiting transaction can allocate its identifier.
Therefore, it would be advantageous to have a methodology for reducing synchronization waits when unique, sequenced identifiers are being allocated for transactions that are occurring in a multi-threaded server environment.